package team.paimengshop.show;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import team.paimengshop.server_socket.ServerManage;
import team.paimengshop.server_socket.SocketThreadControl;

import java.io.IOException;
import java.net.ServerSocket;

public class Main extends Application
{

    @Override
    public void start(Stage stage) throws IOException
    {
        FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("ServerMain.fxml"));

        Scene scene = new Scene(fxmlLoader.load(), 600, 370);
        stage.setTitle("派蒙的周边商铺服务端");
        stage.setScene(scene);
        Image logo = new Image("file:PaiMengShop/PaiMengShopServer/src/main/resources/team/paimengshop/show/image/logo.png");  //设置图标
        stage.getIcons().add(logo);
        stage.show();

        Thread socketThread = new Thread(new SocketThreadControl());
        socketThread.start();
    }

    public static void main(String[] args) {
        launch();
    }
}